package com.jsz.peini.common.util;

import java.util.HashMap;
import java.util.Map;

import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class IdCardSend {
	private static final Logger logger = LoggerFactory.getLogger(IdCardSend.class);
	private static final String host = "http://jisusfzsm.market.alicloudapi.com";
	private static final String path = "/idcardverify/verify";
	private static final String method = "GET";

	public static String checkCard(String idcardName,String idcardId){
    Map<String, String> headers = new HashMap<String, String>();
    String result = "";
	    try {
		    //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
		    headers.put("Authorization", "APPCODE 7374eca9040f4948be4704800115fb4d");
		    Map<String, String> querys = new HashMap<String, String>();
		    querys.put("idcard",idcardId);
		    querys.put("realname",idcardName);
		    HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys);
		    result = EntityUtils.toString(response.getEntity());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			logger.error(e.getMessage(),e);
		}
	return result;
	}


}
